<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const person = {
            name: '师娘',
            age: 32,
            language: ['国语', '东北方言', '日本语']
        }
        console.log(Object.keys(person))
        console.log(Object.values(person))
        console.log(Object.entries(person))

        // 对象内容合并
        let target = { a: 1 }
        let source1 = { b: 1 }
        let source2 = { c: 1 }
        Object.assign(target, source1, source2)
        console.log(target)

        const name = '张三'
        const age = 25
        const person1 = { name, age }
        console.log(person1)

        let person3 = {
            name: '微雨',
            miss: function (who) {
                console.log(this.name + '在想' + who)
            },

            miss1: who => console.log(person3.name + '在念' + who),

            miss2(who) {
                console.log(this.name + '在盼' + who)
            }
        }

        person3.miss('燕双飞')
        person3.miss1('人独立')
        person3.miss1('共白头')

        // 对象拷贝（深拷贝）
        let person2 = { name: "Amy", age: 15 };
        let someone = { ...person2 };
        console.log(someone)
    </script>
</body>

</html>